import { createBrowserRouter } from "react-router-dom";
import { HomeOutlined } from "@ant-design/icons";
import { lazy } from "react";
let Error = lazy(() => import("../pages/404/Index"));
let Order = lazy(() => import("../pages/order/Index"));
let Layout = lazy(() => import("../pages/layout/Index"));
let Home = lazy(() => import("../pages/home/Index"));
let Class = lazy(() => import("../pages/class/Index"));
export let childroute = [
  {
    path: "/",
    element: <Home></Home>,
    icon: <HomeOutlined />,
    name: "客户管理",
  },
  {
    path: "/order",
    element: <Order></Order>,
    icon: <HomeOutlined />,
    name: "会员管理",
  },
  {
    path: "/fl",
    icon: <HomeOutlined />,
    name: "分类",
    children: [
      {
        path: "/fl/class",
        element: <Class></Class>,
        icon: <HomeOutlined />,
        name: "会员分类",
      },
    ],
  },
];
let route = createBrowserRouter([
  {
    path: "/",
    element: <Layout></Layout>,
    children: childroute,
  },
  {
    path: "*",
    element: <Error></Error>,
  },
]);

export default route;
